﻿Public Class frmLogin

    Private Sub btnIngresar_Click(sender As Object, e As EventArgs) Handles btnIngresar.Click
        Try


            If txtUser.TextLength <= 0 Or txtPass.TextLength <= 0 Then
                MessageBox.Show("El campo usuario o contraseña se encuentran en blanco", "Login", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
            Else
                If validarRut(txtUser.Text) And identificacion(capturaRut, pass:=txtPass.Text) Then
                    Me.Hide()
                    frmMain.ShowDialog()
                    Me.Close()
                Else
                    MessageBox.Show("Usuario o contraseña incorrecta", "Login", MessageBoxButtons.OK, MessageBoxIcon.Error)

                End If


            End If

        Catch ex As Exception
            mensajeError(ex)
        End Try






    End Sub

    Private Sub frmLogin_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        'lblFecha.Text = DateTimePicker1.Text
        lblFecha.Text = FormatDateTime(Now, DateFormat.LongDate)


    End Sub
End Class